/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package wbd_au.objects_mappings;

import java.sql.SQLData;
import java.sql.SQLException;
import java.sql.SQLInput;
import java.sql.SQLOutput;

/**
 *
 * @author Iza
 */
public class OpisBroni implements SQLData{
    
    int idOpisBroni;
    String nazwa;
    int kaliber;
    String typ;
        
  
    String sqlType;

    @Override
    public String getSQLTypeName() {
        return sqlType;
    }

    @Override
    public void readSQL(SQLInput stream, String typeName) throws SQLException {
        sqlType = typeName;

        idOpisBroni = stream.readInt();
        nazwa = stream.readString();
        kaliber = stream.readInt();
        typ = stream.readString();
        
    }

    @Override
    public void writeSQL(SQLOutput stream) throws SQLException {
       stream.writeInt(idOpisBroni);
       stream.writeString(nazwa);
       stream.writeInt(kaliber);
       stream.writeString(typ);
       
   }
}
